Optimal. Leaf size=96 \[ \frac{b^2 (6 a+b) \tan ^{-1}\left (\frac{\sqrt{a+b} \tan (x)}{\sqrt{a}}\right )}{2 a^{3/2} (a+b)^{7/2}}+\frac{b^3 \tan (x)}{2 a (a+b)^3 \left ((a+b) \tan ^2(x)+a\right )}+\frac{\tan ^3(x)}{3 (a+b)^2}+\frac{(a+3 b) \tan (x)}{(a+b)^3} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.147673, antiderivative size = 96, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 4, integrand size = 15, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.267, Rules used = {3191, 390, 385, 205} \[ \frac{b^2 (6 a+b) \tan ^{-1}\left (\frac{\sqrt{a+b} \tan (x)}{\sqrt{a}}\right )}{2 a^{3/2} (a+b)^{7/2}}+\frac{b^3 \tan (x)}{2 a (a+b)^3 \left ((a+b) \tan ^2(x)+a\right )}+\frac{\tan ^3(x)}{3 (a+b)^2}+\frac{(a+3 b) \tan (x)}{(a+b)^3} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3191
Rule 390
Rule 385
Rule 205
Rubi steps
\begin{align*} \int \frac{\sec ^4(x)}{\left (a+b \sin ^2(x)\right )^2} \, dx &=\operatorname{Subst}\left (\int \frac{\left (1+x^2\right )^3}{\left (a+(a+b) x^2\right )^2} \, dx,x,\tan (x)\right )\\ &=\operatorname{Subst}\left (\int \left (\frac{a+3 b}{(a+b)^3}+\frac{x^2}{(a+b)^2}+\frac{b^2 (3 a+b)+3 b^2 (a+b) x^2}{(a+b)^3 \left (a+(a+b) x^2\right )^2}\right ) \, dx,x,\tan (x)\right )\\ &=\frac{(a+3 b) \tan (x)}{(a+b)^3}+\frac{\tan ^3(x)}{3 (a+b)^2}+\frac{\operatorname{Subst}\left (\int \frac{b^2 (3 a+b)+3 b^2 (a+b) x^2}{\left (a+(a+b) x^2\right )^2} \, dx,x,\tan (x)\right )}{(a+b)^3}\\ &=\frac{(a+3 b) \tan (x)}{(a+b)^3}+\frac{\tan ^3(x)}{3 (a+b)^2}+\frac{b^3 \tan (x)}{2 a (a+b)^3 \left (a+(a+b) \tan ^2(x)\right )}+\frac{\left (b^2 (6 a+b)\right ) \operatorname{Subst}\left (\int \frac{1}{a+(a+b) x^2} \, dx,x,\tan (x)\right )}{2 a (a+b)^3}\\ &=\frac{b^2 (6 a+b) \tan ^{-1}\left (\frac{\sqrt{a+b} \tan (x)}{\sqrt{a}}\right )}{2 a^{3/2} (a+b)^{7/2}}+\frac{(a+3 b) \tan (x)}{(a+b)^3}+\frac{\tan ^3(x)}{3 (a+b)^2}+\frac{b^3 \tan (x)}{2 a (a+b)^3 \left (a+(a+b) \tan ^2(x)\right )}\\ \end{align*}
Mathematica [A] time = 0.970912, size = 97, normalized size = 1.01 \[ \frac{1}{6} \left (\frac{3 b^2 (6 a+b) \tan ^{-1}\left (\frac{\sqrt{a+b} \tan (x)}{\sqrt{a}}\right )}{a^{3/2} (a+b)^{7/2}}+\frac{\frac{3 b^3 \sin (2 x)}{a (2 a-b \cos (2 x)+b)}+2 (a+b) \tan (x) \sec ^2(x)+4 a \tan (x)+16 b \tan (x)}{(a+b)^3}\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.102, size = 193, normalized size = 2. \begin{align*}{\frac{ \left ( \tan \left ( x \right ) \right ) ^{3}a}{ \left ( 3\,{a}^{2}+6\,ab+3\,{b}^{2} \right ) \left ( a+b \right ) }}+{\frac{ \left ( \tan \left ( x \right ) \right ) ^{3}b}{ \left ( 3\,{a}^{2}+6\,ab+3\,{b}^{2} \right ) \left ( a+b \right ) }}+{\frac{\tan \left ( x \right ) a}{ \left ({a}^{2}+2\,ab+{b}^{2} \right ) \left ( a+b \right ) }}+3\,{\frac{\tan \left ( x \right ) b}{ \left ({a}^{2}+2\,ab+{b}^{2} \right ) \left ( a+b \right ) }}+{\frac{{b}^{3}\tan \left ( x \right ) }{2\, \left ( a+b \right ) ^{3}a \left ( \left ( \tan \left ( x \right ) \right ) ^{2}a+ \left ( \tan \left ( x \right ) \right ) ^{2}b+a \right ) }}+3\,{\frac{{b}^{2}}{ \left ( a+b \right ) ^{3}\sqrt{a \left ( a+b \right ) }}\arctan \left ({\frac{ \left ( a+b \right ) \tan \left ( x \right ) }{\sqrt{a \left ( a+b \right ) }}} \right ) }+{\frac{{b}^{3}}{2\, \left ( a+b \right ) ^{3}a}\arctan \left ({ \left ( a+b \right ) \tan \left ( x \right ){\frac{1}{\sqrt{a \left ( a+b \right ) }}}} \right ){\frac{1}{\sqrt{a \left ( a+b \right ) }}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 2.45104, size = 1481, normalized size = 15.43 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.14682, size = 365, normalized size = 3.8 \begin{align*} \frac{b^{3} \tan \left (x\right )}{2 \,{\left (a^{4} + 3 \, a^{3} b + 3 \, a^{2} b^{2} + a b^{3}\right )}{\left (a \tan \left (x\right )^{2} + b \tan \left (x\right )^{2} + a\right )}} + \frac{{\left (6 \, a b^{2} + b^{3}\right )}{\left (\pi \left \lfloor \frac{x}{\pi } + \frac{1}{2} \right \rfloor \mathrm{sgn}\left (2 \, a + 2 \, b\right ) + \arctan \left (\frac{a \tan \left (x\right ) + b \tan \left (x\right )}{\sqrt{a^{2} + a b}}\right )\right )}}{2 \,{\left (a^{4} + 3 \, a^{3} b + 3 \, a^{2} b^{2} + a b^{3}\right )} \sqrt{a^{2} + a b}} + \frac{a^{4} \tan \left (x\right )^{3} + 4 \, a^{3} b \tan \left (x\right )^{3} + 6 \, a^{2} b^{2} \tan \left (x\right )^{3} + 4 \, a b^{3} \tan \left (x\right )^{3} + b^{4} \tan \left (x\right )^{3} + 3 \, a^{4} \tan \left (x\right ) + 18 \, a^{3} b \tan \left (x\right ) + 36 \, a^{2} b^{2} \tan \left (x\right ) + 30 \, a b^{3} \tan \left (x\right ) + 9 \, b^{4} \tan \left (x\right )}{3 \,{\left (a^{6} + 6 \, a^{5} b + 15 \, a^{4} b^{2} + 20 \, a^{3} b^{3} + 15 \, a^{2} b^{4} + 6 \, a b^{5} + b^{6}\right )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]